<template>
  <div>
    <app-header></app-header>
    <img src="../assets/logo.png" alt="">
    <div class="span-container">
      <router-link to="/auth/login"><span @click="toLogin" style="color: #2285ff" ref="crt">登录</span></router-link>
      <span class="span-1">|</span>
      <router-link to="/auth/register"><span @click="toRegister" ref="xrc">注册</span></router-link>
    </div>
    <!--动态组件-->
   <router-view></router-view>
  </div>
</template>

<script>
import appHeader from '../components/appHeader'
import 'lib-flexible';

export default {
  name: "loginReg",
  data() {
    return {
    };
  },
  components: {
    appHeader,
  },
  methods: {
    toLogin() {
      this.$refs.crt.style.color = '#2285ff';
      this.$refs.xrc.style.color = null;
    },
    toRegister() {
      this.$refs.xrc.style.color = '#2285ff';
      this.$refs.crt.style.color = null;
    }
  }

}
</script>

<style scoped>
  img{
    width: 60px;
    display: block;
    margin: 24px auto;
    position: relative;
    top: 1.4rem;
  }
  .span-container{
    height: 1rem;
    width: 100vw;
    text-align: center;
    font-size: .4rem;
    line-height: 1rem;
    position: relative;
    top: 1.4rem;
  }
  .span-1{
    display: inline-block;
    width: 2rem;
    text-align: center;
    color: rgba(0,0,0,.6);
  }
  a{
    text-decoration: none;
    color: black;
  }

</style>
